// TestScene.h
//
#pragma once

#include "QtFwk/GLGraphicsScene.h"

#include "Rendering/TrackBall.h"
#include "Rendering/Camera.h"
#include "OpenGL/FrameBuffer.h"
#include "OpenGL/Program.h"
#include "OpenGL/Font.h"

class VObjectManager;
class CadEngine;

class TestScene : public QtFwk::GLGraphicsScene
{
private:
	OpenGL::TrackBall    _trackball;
	OpenGL::Camera       _camera;
	OpenGL::FontTexture  _fonts;
	OpenGL::Texture2DPtr _target;
	OpenGL::Texture2DPtr _depth;
	OpenGL::Texture2DPtr _color;
	OpenGL::FrameBuffer  _fbo;
	OpenGL::Program      _program;
	OpenGL::Program      _ssao;

	CadEngine          *_cadEngine;
	VObjectManager     *_objectManager;
	bool _wireframe;

public:
	TestScene( QWidget *parent );
	~TestScene();

	void postInitialization();

	CadEngine *cadEngine() { return _cadEngine; }

	void rotateScene( double degrees );
	void zoomScene();
	void translateScene();
	void confirm();
	void toggleWireframe();

	void drawBackground(QPainter *painter, const QRectF &rect);

	void resizeScene( int w, int h );


	void onMousePressed();
	void onMouseReleased();
	void onMouseMoved();
	void onMouseWheel();
	void onMouseDoubleClick();
};